import {
	defineStore
} from 'pinia';

export const useTimesStore = defineStore('times', {
	state: () => {
		return {
			// timeout: 1000 * 60 * 10 * 2, // 20分钟 超时
			// timeout: 1000 * 10, // 测试 超时
			// lastTimes: Date.now(), // 最后操作时间
			lastTime: new Date().getTime(),
			longTime: false,
		};
	},
	getters: {
		getTimeout(state) {
			return state.timeout;
		},
		getLastTimes(state) {
			return state.lastTimes;
		},
		getLongTIme(state) {
			return state.longTime
		},
	},
	actions: {
		setLastTimesState(data) {
			this.lastTimes = data;
		},
		setLongTimeState(data) {
			this.longTime = data
		}
	},
});